package com.ai.trickycards.widgets

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.constraintlayout.widget.ConstraintLayout

class MonitorTouchConstraintLayout @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0,
    defStyleRes: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr, defStyleRes) {

    var onTouchListener: ((MotionEvent?) -> Unit)? = null

    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        onTouchListener?.invoke(ev)
        return super.dispatchTouchEvent(ev)
    }
}